package ribbonconfiguration;

import com.netflix.loadbalancer.IRule;
import com.netflix.loadbalancer.RandomRule;
import com.trt.contentcenter.configuration.NacosSameClusterWeightedRule;
import com.trt.contentcenter.configuration.NacosWeightedRule;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @version 1.0
 * @author: trt
 * @description:
 * @create: 2021-03-21 23:41
 */
@Configuration
public class RibbonConfiguration {

    @Bean
    public IRule ribbonRule(){
//        return new RandomRule();
        // 全局配置支持权重的
        // return new NacosWeightedRule();
        return new NacosSameClusterWeightedRule();
    }
}